package zumyi12;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 客车类
 */
@Data
@NoArgsConstructor
public class Bus extends AutoMobile {
     private int seatNumbet;//座位数

    public Bus(String brand, String sign, int seatNumbet, int dayRent) {
        super(brand, sign, dayRent);
        this.seatNumbet = seatNumbet;
    }

    public Bus(int seatNumbet) {
        this.seatNumbet = seatNumbet;
    }

    //重写了汽车类的计算租金的抽象方法
    @Override
    public double callRent(int days) {
        if(days<3){
            return days*this.getDayRent();
        }else if(days<7){
            return days*this.getDayRent()*0.9;
        }else if(days<30){
            return days*this.getDayRent()*0.8;
        }else if(days<150){
            return days*this.getDayRent()*0.7;
        }else{
            return days*this.getDayRent()*0.6;
        }

    }
}
